package com.lots.controller.user;

import com.lots.domain.entity.Advertisement;
import com.lots.service.AdvertisementService;
import com.lots.utils.Result;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Slf4j
@RequestMapping("/advertisement")
@Tag(name = "广告相关接口")
public class AdvertisementController {
    @Autowired
    private AdvertisementService advertisementService;


    @Operation(summary = "查询所有广告")
    @GetMapping("/list")
    public Result getAdvertisementList() {
        List<Advertisement> list = advertisementService.getList();
        return Result.success(list);
    }
}
